//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef _USB_SERIAL_DOWNLOAD_H
#define _USB_SERIAL_DOWNLOAD_H

#define USBCOMMANDLEN    4
#define USBDATASIZELEN   2
//#define USBDATAMAXLEN  64
//#define FLASH_SIZE_128M
#define USBRESPONSELEN  (USBCOMMANDLEN)

//int udownload_cmd(u32 *destAddress, u32 bufLen);

enum UsbCommandType
{
    UsbShakehand = 'a',
    UsbClientReceive,
    UsbClientSend,
    UsbClientResponse,
    UsbClientError,
    UsbClientFlash,

    UsbExit,

    UsbCommandMax
};

enum UsbResponseType
{
    UsbResponseOK = 'A',
    UsbResponseError,
    UsbResponseAgain,

    UsbResponseShakehand,
    UsbResponseExit,
    UsbResponseFlash,
};

enum FlashImageType
{
    FlashImageTypeBootLoader = '0',
    FlashImageTypeIplSpl,
    FlashImageTypeKernel,
    FlashImageTypeRootFS,
    FlashImageTypeProgramFS,
    FlashImageTypeUserFS,
    FlashImageTypeUserLocalFS,
    FlashImageTypePTable,
    FlashImageTypeInitImage,
    FlashImageTypeUIPackage,
    FlashImageTypeFactory,
    FlashImageTypeGSMModule,
    FlashImageTypeDspPatch,
    FlashImageTypeSysParmInd,
    FlashImageTypeSysParmDep,
    FlashImageBootloader_FormatDoc,
    FlashImageTypeMax
};

int UsbDownloadImage( void );

#endif
